package it.ap.sa.acqua.dao.beans;

import java.time.LocalDate;

import it.ap.sa.core.utils.DateTimeUtil;

public class TUserBean {
	
	private Long id;

	private String password;

	private String ssoId;

	private String firstName;

	private String lastName;

	private String email;
	
	private String urlImage;
	
	private String dateBirthStr;
	
	private LocalDate dateBirth;

	public TUserBean() {
		super();
	}

	public TUserBean(Long id, String password, String ssoId, String firstName, String lastName, String email,
			String urlImage, String dateBirthStr, LocalDate dateBirth) {
		super();
		this.id = id;
		this.password = password;
		this.ssoId = ssoId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.urlImage = urlImage;
		this.dateBirthStr = dateBirthStr;
		this.dateBirth = dateBirth;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSsoId() {
		return ssoId;
	}

	public void setSsoId(String ssoId) {
		this.ssoId = ssoId;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUrlImage() {
		return urlImage;
	}

	public void setUrlImage(String urlImage) {
		this.urlImage = urlImage;
	}

	public String getDateBirthStr() {
		return dateBirthStr;
	}

	public void setDateBirthStr(String dateBirthStr) {
		this.dateBirthStr = dateBirthStr;
	}

	public LocalDate getDateBirth() {
		try {
			dateBirth = DateTimeUtil.transformStringToLocalDate(this.dateBirthStr, DateTimeUtil.DDMMYYYY_Slash);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return dateBirth;
	}

	public void setDateBirth(LocalDate dateBirth) {
		try {
			this.dateBirth = DateTimeUtil.transformStringToLocalDate(this.dateBirthStr, DateTimeUtil.DDMMYYYY_Slash);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
